const arr = []

for(let i=0; i<100000; i++){
  arr.push(Math.floor(Math.random()* 11 ))
}

const max = Math.max(...arr)
const min = Math.min(...arr)

console.log(max, min)

let showTime = {}
for(let i=0; i<11; i++){
  showTime[i] = arr.filter(a => a === i).length
}

Object.keys(showTime).forEach(s => {
  console.log(`${s} 出现了 ${showTime[s]}次`)
})
